#e[Stage]
#Title[bCxg]
#Text[Ǝ̉bCxg쐬
bGoꁨbe
𓌕eŖ{ƕɍČ
Ҍi
byi̐l]
#Player[FREE]
#BackGround[User()]
#ScriptVersion[2]

script_stage_main{

	//	̃XNvgɃ{X͈؏oĂ܂
	//	{XۂĂ邾̎Gł

	let Current = GetCurrentScriptDirectory;
	SetCommonData("SPELL_SCORE", 0);
	SetCommonData("X", 0);
	SetCommonData("Y", 0);
	PlayMusic(Current~"BGM\BGM.mp3");
	let BG_IMG = Current ~ "IMG\BG.png";
	let Add_Y = 0;

	@Initialize{
		LoadGraphic(BG_IMG);
		CompileEnemyFromFile(Current ~ "ENEMY\b.txt");
		CompileEnemyFromFile(Current ~ "ENEMY\End.txt");
		TMain;
	}

	@MainLoop{
		yield;
	}

	@BackGround{
		SetPerspectiveClip(0, 10000);
		SetViewTo(0, 0, 0);
		SetViewFrom(600, 90, 65);
		SetFog(300, 1500, 0, 0, 0);

		SetTexture(BG_IMG);
		SetGraphicRect(0, 0 + Add_Y, 1024, 1024 + Add_Y);
		SetGraphicAngle(-90, 0, 0);
		DrawGraphic3D(0, 0, 0);

	}

	@Finalize{
		FadeOutMusic(Current~"BGM\BGM.mp3", 25);
	}

	task TMain{
		BG_Work;
		loop(120){ yield; }
		CreateEnemyFromFile(Current ~ "ENEMY\b.txt", -100, -100, 0, 0, 0);
		while(GetEnemyNum){ yield; }
		CreateEnemyFromFile(Current ~ "ENEMY\End.txt", -100, -100, 0, 0, 0);
		STI;
		loop(120){ yield; }
		Draw_Spell_Score;
		while(GetEnemyNum){ yield; }
		loop(120){ yield; }
		ClearStage;
	}

	task BG_Work{
		loop{
			Add_Y += 1.5;if(Add_Y >= 512){ Add_Y -= 512; }
			yield;
		}
	}

	#include_function ".\STAGE_INCLUDE\Stage_INI.dms"

}